from ConfigUser import *

c = Config()

assert c.configFile == "configUser.txt"

c = Config("TestConfigUser.txt")
assert c.getProperty("username")=="lwooley@completesolar.com"
assert c.getProperty("PASSWORD")=="FALSEPASSWORD"
assert c.getProperty("password")=="FALSEPASSWORD"
assert c.getProperty("PassWord")=="FALSEPASSWORD"
assert c.getProperty("PASSWORD")!="falsepassword"
assert c.getProperty("monkeyStapler")==""
assert c.hasProperty("monkeyStapler")==False
assert c.hasProperty("PassWord")
assert c.getProperty("ctype")=="1"
assert c.getProperty("jobref")=="A-Tec"
assert c.getProperty("jobref")!="a-Tec"
assert c.getProperty("cfirstname")=="test"
assert c.getProperty("clastname")=="customer (Automatic)"
assert c.getProperty("cphone1")=="555-555-5555"
assert c.getProperty("cemail")=="sample@email.com"
assert c.getProperty("caddress1")=="123 Smith Lane"
assert c.getProperty("ccity")=="Menlo Park"
assert c.getProperty("czip")=="94070"
assert c.getProperty("cutility1")=="291"
assert c.getProperty("usetou")=="1"
assert c.getProperty("tilt")==["35", "16", "25"]
assert c.getProperty("azimuth")==["90","180","90"]
assert c.getProperty("shading1")==["100","100","100","100","100","100","100","100","100","100","100","100"]
assert c.hasProperty("shading2")==True
assert c.hasProperty("shading3")==True
assert c.hasProperty("euse")==True
assert c.getProperty("collectorid")=="CS6P-230P"
assert c.getProperty("inverterid")=="M215-60-240-S2x"
assert c.getProperty("incentive")=="9"
assert c.getProperty("nummod")==["12","13","14"]
assert c.getProperty("kwh")==["2.76","2.99","3.22"]
assert c.getProperty("dsnfactor")==["90","90","95"]
assert c.getProperty("product")=="Greenday PPA"
assert c.getProperty("installthisyear")=="1"
assert c.getProperty("initialpayment")=="1000"
assert c.getProperty("annualincrease")=="3.5"
assert c.getProperty("maxsystemprice")=="450"

assert c.genericProperties['username']=='lwooley@completesolar.com'
assert c.genericProperties['cheight1']=='500'
assert c.genericProperties['clength1']=='500'
assert c.genericProperties['soiling']=='2'
assert c.genericProperties['inoct1']=='44'
assert c.genericProperties['invid_a1']=='917'
assert c.genericProperties['presolarrate1']=='4042'
assert c.getProperty("presolarrate1")=='4042'
assert c.genericProperties['crate1']=='4060'
assert c.genericProperties['siteassessment']=='0'
